const setStorage = (key, data) => {
    return new Promise((resolve) => {
        wx.setStorage({
            key,
            data,
            complete(res) {
                resolve(res)
            }
        })
    })
}

const getStorage = (key) => {
    return new Promise((resolve) => {
        wx.getStorage({
            key,
            complete(res) {
                resolve(res)
            }
        })
    })
}

const removeStorage = (key) => {
    return new Promise((resolve) => {
        wx.removeStorage({
            key,
            complete(res){
                resolve(res)
            }
        })
    })
}

const clearStorage = () => {
    return new Promise((resolve) => {
        wx.clearStorage({
            key,
            complete(res){
                resolve(res)
            }
        })
    })
}

export { setStorage, getStorage, removeStorage, clearStorage }